package cn.kongwg.singn;

/**
 * @author kongwg
 * @create 2021-05-16 12:15
 */

public  class Person {

    private int id;
    private String name;
    private int sex;



    private Person() {
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public void say() {
        System.out.println("wo hui shuohua ");
    }

    public void sleep() {
        System.out.println("i love sleep");
    }

    private  static  Person person = null;

    public static synchronized Person createPerson() {
        if (person == null) {
            Person person = new Person();
            return person;
        }
        return person;
    }
}
